package spring.cloud.tasks.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import spring.cloud.tasks.api.database.entity.ZooKeeperClusterDto;
import spring.cloud.tasks.api.database.service.ZooKeeperClusterDtoService;

import java.util.List;

@RestController
public class Action {
    @Autowired
    private ZooKeeperClusterDtoService zooKeeperClusterDtoService;

    @ResponseBody
    @RequestMapping("/helloWorld")
    public List<ZooKeeperClusterDto> helloWorld() {
        List<ZooKeeperClusterDto> zooKeeperClusterDtoList = zooKeeperClusterDtoService.selectAll();
        return zooKeeperClusterDtoList;
    }
}
